package com.yanqu.road.server.cmd.grandchild;

import com.yanqu.road.pb.grandchild.GrandChildProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.grandchild.GrandChildMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_GRAND_CHILD_SET_EXAM_HANDLE_STATUS, desc = "科举处理状态")
public class CrossSetExamHandleStatusCmd extends CrossCommand {

    private long examNo;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        GrandChildProto.CrossSetExamHandleStatusReqMsg reqMsg = GrandChildProto.CrossSetExamHandleStatusReqMsg.parseFrom(packet.getBytes());
        examNo = reqMsg.getExamNo();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        GrandChildMgr.removeToHandleExam(examNo, serverId);
    }

    @Override
    public void sendData() {

    }
}
